package Demo;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Test1 {
    public static void main(String[] args) {
        List<Title> list = new ArrayList();
        list.add(new Title(1,"周春印吸毒","张三"));
        list.add(new Title(1,"周春印吸毒","张三"));
        list.add(new Title(1,"周春印吸毒","张三"));
        Title t = new Title(2,"周春印吸毒","张三");
        list.add(t);
        System.out.println(list.contains(t));

        for (Title title : list) {
            System.out.println(title.getName());
        }

        LinkedList<Title> list1 = new LinkedList<>();

        list1.add(new Title(1,"周春印吸毒1","张三"));
        list1.add(new Title(1,"周春印吸毒2","张三"));
        list1.add(new Title(1,"周春印吸毒3","张三"));
        Title q = new Title(1,"周春印吸毒9","张三");
        list1.addFirst(q);
        System.out.println(list1.contains(q));

        for (Title title : list) {
            System.out.println(title.getName());
        }

    }
}
